var express = require('express')
const router = express.Router()
const path = require('path')
const fs = require('fs')


router.use(function(req, res, next){
    console.log('做当前路由下 权限拦截')
    next()
})
router.post('/policy/getVerifyCodeByMobile', function(req, res){
    res.send({
        "code": 200,
        "msg": "ok",
        "data": null 
    })
})
router.post('/policy/accessUsers', function(req, res){
    res.send({
        "code": 200,
        "msg": "ok",
        "data": [
            {
                "userId": "unit-test-user-id-1",
                "certType": "ID_CARD",
                "certNo": "31042519871012371X",
                "userName": "孙悟红"
            }
        ]  
    })
})
router.post('/policy/immediateReceive', function(req, res){
    res.send({
        "code": 200,
        "msg": "ok",
        "data": null 
    })
})
router.post('/policy/detail', function(req, res){
	res.send({
        "code": 200,
        "msg": "ok",
        "data": {
            "insurancePolicyId": 1,
            "userId": "unit-test-user-id-1",
            "orderNo": "202006241504332132",
            "policyNo": "202006241504332132",
            "productId": 1,
            "productName": "健保e生·住院医疗",
            "insurantId": 5,
            "insurantName": "孙悟红",
            "policyPremium": 199.99,
            "policyAmount": 6000000,
            "effectiveTime": "2020-06-25 04:06:21",
            "expiredTime": "2021-06-25 04:06:28",
            "duration": "1年",
            "waitingPeriod": "本合同的等待期为30天， 扁桃腺、甲状腺、疝气、女性生殖系统疾病的检查与治疗等待期为120天。意外医疗或续保无等待期。 若以上等待期有冲突者，以最长时间为准。",
            "deductible": 6000000,
            "status": "GUARANTEE"
        }
    })
})

router.post('/product/getProductPdf', function(req, res){
    res.send({
        "code": 200,
        "msg": "ok",
        "data": {
            "productId": 1,
            "clause": "http://yjk-insurance.oss-cn-shanghai.aliyuncs.com/product/pdf/1593393833296.pdf",
            "claims": "http://yjk-insurance.oss-cn-shanghai.aliyuncs.com/product/pdf/1593393833797.pdf",
            "appoint": "http://yjk-insurance.oss-cn-shanghai.aliyuncs.com/product/pdf/1593393833907.pdf",
            "specialOccupation": "http://yjk-insurance.oss-cn-shanghai.aliyuncs.com/product/pdf/1593393833957.pdf",
            "declaration": "http://yjk-insurance.oss-cn-shanghai.aliyuncs.com/product/pdf/1593393834017.pdf",
            "notice": "http://yjk-insurance.oss-cn-shanghai.aliyuncs.com/product/pdf/1593393834061.pdf"
        }
    })
})
router.post('/product/getProductDetail', function(req, res){
    res.send({
        "msg": "请求成功",
        "code": 200,
        "data": {
          "BZSM": [
            {
              "id": 4,
              "productId": 1,
              "configKey": "JYFW",
              "configType": "BZSM",
              "configValue": "中国境内（不含港澳台地区）二级或二级以上公里医院普通部",
              "configDesc": "就医范围"
            },
            {
              "id": 5,
              "productId": 1,
              "configKey": "BZFW",
              "configType": "BZSM",
              "configValue": "责任内不限医保目录范围",
              "configDesc": "保障范围"
            },
            {
              "id": 6,
              "productId": 1,
              "configKey": "LQDQ",
              "configType": "BZSM",
              "configValue": "全国",
              "configDesc": "领取地区"
            },
            {
              "id": 7,
              "productId": 1,
              "configKey": "LQFS",
              "configType": "BZSM",
              "configValue": "1份",
              "configDesc": "领取份数"
            },
            {
              "id": 8,
              "productId": 1,
              "configKey": "TBNL",
              "configType": "BZSM",
              "configValue": "1出生满28天-60周岁，可续保至100周岁",
              "configDesc": "投保年龄"
            }
          ],
          "BZZR": [
            {
              "id": 1,
              "productId": 1,
              "configKey": "YBYL_BXJ",
              "configType": "BZZR",
              "configValue": "100万元",
              "configDesc": "一般医疗保险金"
            },
            {
              "id": 2,
              "productId": 1,
              "configKey": "ZDJBYL_BXJ",
              "configType": "BZZR",
              "configValue": "100万元",
              "configDesc": "重大疾病医疗保险金"
            },
            {
              "id": 3,
              "productId": 1,
              "configKey": "ZLZLZYL_BXJ",
              "configType": "BZZR",
              "configValue": "100万元",
              "configDesc": "质量重离子医疗保险金"
            }
          ]
        },
        "tid": null
      })
})



module.exports = router